//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package sto.android.app;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.provider.Settings.Global;
import android.provider.Settings.Secure;
import android.util.Log;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import sto.android.app.KaiScanner2D;
import sto.android.app.StoJNI;
import sto.android.app.StoJNI.ScanCallBack;

public class KaicomJNI implements StoJNI {
    private static final String KAICOM_DISABLE_USB_DEBUG = "com.kaicom.disable_usb_debug";
    private static final String KAICOM_DISABLE_SCREEN_LOCK = "com.kaicom.disable.screen_lock";
    private static final String KAICOM_DISABLE_INSTALL_PACKAGE = "com.kaicom.disable.install.package";
    private static final String KAICOM_DISABLE_STATUSBAR_EXPAND = "com.kaicom.disable_statusbar_expand";
    private static final String KAICOM_SYSTEM_REBOOT = "com.kaicom.system_reboot";
    private static final String KAICOM_SYSTEM_SHUTDOWN = "com.kaicom.system_shutdown";
    private static final String KAICOM_SET_SYSTEM_TIME = "com.kaicom.set_system_time";
    private static final String KAICOM_SET_MACHINE_CODE = "com.kaicom.set.machine.code";
    private static final String KAICOM_SET_GPIO_STATUS = "com.kaicom.set.gpio.status";
    public static final String KAICOM_DISABLE_KEYPAD = "com.kaicom.disable_keypad";
    public static final String KAICOM_DISABLE_KEYPAD_STRING = "kaicom_disable_keypad_string";
    private static final String KAICOM_DISABLE_KEYDOWN_TONE = "com.kaicom.disable.keydowntone";
    private static final String KAICOM_DISABLE_SCAN_MESSAGE = "com.kaicom.disable.scan.message";
    private static final String KAICOM_DISABLE_TOUCH_SCREEN = "com.kaicom.disable.touch_screen";
    private static final String KAICOM_DISABLE_SCAN_MESSAGE_ENTER = "com.kaicom.disable.scan.message.enter";
    private static final String KAICOM_ANYKEY_WAKEUP = "com.kaicom.anykey.wakeup";
    private static final String KAICOM_INSTALL_PACKAGE_WITH_SILENCE = "com.kaicom.install.packege.with.silence";
    private static final String KAICOM_INSTALL_PACKAGE_EXTRA_APK_PATH = "com.kaicom.install.packege.extra.apk.path";
    private static final String KAICOM_INSTALL_PACKAGE_EXTRA_TIPS_FORMAT = "com.kaicom.install.packege.extra.tips.format";
    private static final String KAICOM_DISABLE_BROWSER = "com.kaicom.disable.browser";
    private static final String KAICOM_CONFIG_GPS_STATUS = "com.kaicom.config.gps.status";
    private static KaicomJNI kaicomJNI;
    private static String TAG;
    private Context mContext;
    private int mScanModel = 0;
    private int mPlatform = 0;
    KaiScanner2D mScanner = null;
    ScanCallBack mScanCB;
    String mScanCode;
    public static final int PLATFORM_WDT420 = 1;
    public static final int PLATFORM_WDT585 = 2;
    public static final int PLATFORM_WDT520 = 3;
    public static final int PLATFORM_WDT521 = 3;
    public static final int PLATFORM_WDT520S = 3;
    public static final int PLATFORM_WDT585P = 3;
    public static final int PLATFORM_WDT510 = 4;
    public static final int PLATFORM_WDT550 = 5;
    public static final int PLATFORM_WDTK7 = 3;
    public static final String ERROR = "ERROR";
    private static StringBuilder sResult;

    static {
        label31: {
            TAG = "kaicomJNI";
            new Build();
            if(!Build.MODEL.equals("520")) {
                new Build();
                if(!Build.MODEL.equals("521")) {
                    new Build();
                    if(!Build.MODEL.endsWith("520S")) {
                        new Build();
                        if(!Build.MODEL.endsWith("585P")) {
                            new Build();
                            if(Build.MODEL.equals("510")) {
                                System.loadLibrary("kaicom510");
                            } else {
                                new Build();
                                if(Build.MODEL.equals("585")) {
                                    System.loadLibrary("kaicom585");
                                } else {
                                    new Build();
                                    if(Build.MODEL.equals("420")) {
                                        System.loadLibrary("kaicom420");
                                    } else {
                                        new Build();
                                        if(Build.MODEL.equals("550")) {
                                            System.loadLibrary("kaicom550");
                                        } else {
                                            new Build();
                                            if(Build.MODEL.equals("K7")) {
                                                System.out.println("############loadlib kaicomK7");
                                                System.loadLibrary("kaicomk7");
                                                System.out.println("############loadlib 22222  kaicomK7");
                                            } else {
                                                System.loadLibrary("kaicom420");
                                            }
                                        }
                                    }
                                }
                            }
                            break label31;
                        }
                    }
                }
            }

            System.loadLibrary("kaicom520");
        }

        sResult = new StringBuilder("");
    }

    private KaicomJNI(Context context) {
        this.mContext = context;
        this.mScanModel = this.getmScanModel();
        this.mPlatform = this.getPlatform();
    }

    public static KaicomJNI getInstance(Context context) {
        if(kaicomJNI == null) {
            kaicomJNI = new KaicomJNI(context);
        }

        return kaicomJNI;
    }

    public native int GetPlatform();

    public native void SetGPIOStatus(int var1, int var2);

    public void SetGPIOStatusJNI(int gpio, int status) {
        this.SetGPIOStatus(gpio, status);
    }

    private native void setScannerOn();

    public void SetScannerOn() {
        if(this.mScanModel == 2) {
            if(this.mScanner == null) {
                this.mScanner = new KaiScanner2D(this.mScanCB);
            }

            this.mScanner.doOpen(this.mContext);
            this.toUser_ics();
        } else {
            this.setScannerOn();
        }

    }

    private native void setScannerStart();

    public void SetScannerStart() {
        if(this.mScanModel == 2) {
            if(this.mScanner == null) {
                this.mScanner = new KaiScanner2D(this.mScanCB);
            }

            this.mScanner.doStart();
        } else {
            this.setScannerStart();
        }

    }

    private native void setScannerStop();

    public void SetScannerStop() {
        if(this.mScanModel == 2) {
            if(this.mScanner == null) {
                this.mScanner = new KaiScanner2D(this.mScanCB);
            }

            this.mScanner.doStop();
        } else {
            this.setScannerStop();
        }

    }

    private native void setScannerOff();

    public void SetScannerOff() {
        if(this.mScanModel == 2) {
            if(this.mScanner == null) {
                this.mScanner = new KaiScanner2D(this.mScanCB);
            }

            Log.e("xujiademo", "isAllowScreenShotChordEnabled1111111");
            this.toUser_ics();
            this.mScanner.doSetValue(306, 0);
            this.mScanner.doSetValue(298, 0);
            this.mScanner.doStart();

            try {
                Thread.sleep(100L);
            } catch (InterruptedException var2) {
                ;
            }

            this.toUserr_ics();
            this.mScanner.doStop();
            this.mScanner.doClose();
            this.toRoot_ics();
            Log.d("xujiademo", "isAllowScreenShotChordEnabled2222222");
        } else {
            this.setScannerOff();
        }

    }

    private void toUserr_ics() {
        try {
            execCommand(new String[]{"/system/bin/sh", "-c", "echo 2 > /sys/module/tpd_setting/parameters/screen_shot_enable"});
        } catch (Exception var2) {
            Log.d("xujiademo", "isAllowScreenShotChordEnabled e==" + var2);
        }

    }

    private void toUser_ics() {
        try {
            execCommand(new String[]{"/system/bin/sh", "-c", "echo 0 > /sys/module/tpd_setting/parameters/screen_shot_enable"});
        } catch (Exception var2) {
            Log.d("xujiademo", "isAllowScreenShotChordEnabled e==" + var2);
        }

    }

    private void toRoot_ics() {
        try {
            execCommand(new String[]{"/system/bin/sh", "-c", "echo 1 > /sys/module/tpd_setting/parameters/screen_shot_enable"});
        } catch (Exception var2) {
            Log.d("xujiademo", "isAllowScreenShotChordEnabled e==" + var2);
        }

    }

    public static int execCommand(String[] command) throws IOException {
        Runtime runtime = Runtime.getRuntime();
        Process proc = runtime.exec(command);
        InputStream inputstream = proc.getInputStream();
        InputStreamReader inputstreamreader = new InputStreamReader(inputstream);
        BufferedReader bufferedreader = new BufferedReader(inputstreamreader);
        sResult.delete(0, sResult.length());

        try {
            if(proc.waitFor() == 0) {
                String e;
                while((e = bufferedreader.readLine()) != null) {
                    sResult.append(e);
                }

                return 0;
            }
        } catch (InterruptedException var16) {
            return -1;
        } finally {
            if(bufferedreader != null) {
                try {
                    bufferedreader.close();
                } catch (IOException var15) {
                    ;
                }
            }

        }

        return -1;
    }

    private native int setScannerPara(int var1, int var2);

    private native int getScannerPara(int var1);

    private native String setScannerStringPara(String var1, String var2);

    private native String getScannerStringPara(String var1);

    public int SetScannerPara(int para, int value) {
        return this.setScannerPara(para, value);
    }

    public int GetScannerPara(int para) {
        boolean ret = true;
        int ret1 = this.getScannerPara(para);
        return ret1;
    }

    public String SetScannerPara(String para, String value) {
        return this.setScannerStringPara(para, value);
    }

    public String GetScannerPara(String para) {
        return this.getScannerStringPara(para);
    }

    private native void setScannerRetriger();

    public void SetScannerRetriger() {
        if(this.mScanModel == 2) {
            if(this.mScanner == null) {
                this.mScanner = new KaiScanner2D(this.mScanCB);
            }

            this.mScanner.resetTrigger();
        } else {
            this.setScannerRetriger();
        }

    }

    private native void setScannerTimerOut(int var1);

    public void SetScannerTimerOut(int sec) {
        if(this.mScanModel == 2) {
            if(this.mScanner == null) {
                this.mScanner = new KaiScanner2D(this.mScanCB);
            }

            this.mScanner.setTimeout(sec);
        } else {
            this.setScannerTimerOut(sec);
        }

    }

    private native boolean getScannerIsScanning();

    public boolean GetScannerIsScanning() {
        return this.getScannerIsScanning();
    }

    public native int GetScannerModel();

    public int getmScanModel() {
        return this.GetScannerModel();
    }

    private native void setSystemReboot();

    public void SetSystemReboot() {
        if(this.mPlatform != 1 && this.mPlatform != 4) {
            if(this.mPlatform == 5) {
                Intent intent = new Intent("com.kaicom.system_reboot");
                if(this.mContext != null) {
                    this.mContext.sendBroadcast(intent);
                }
            } else {
                this.rongQi_SetSystemReboot();
            }
        } else {
            this.setSystemReboot();
        }

    }

    private native void setSystemShutdown();

    public void SetSystemShutdown() {
        if(this.mPlatform != 1 && this.mPlatform != 4) {
            if(this.mPlatform != 2 && this.mPlatform != 3) {
                if(this.mPlatform == 5) {
                    Intent intent = new Intent("com.kaicom.system_shutdown");
                    if(this.mContext != null) {
                        this.mContext.sendBroadcast(intent);
                    }
                }
            } else {
                this.rongQi_SetSystemShutdown();
            }
        } else {
            this.setSystemShutdown();
        }

    }

    private native void setSystemTime(String var1);

    public void SetSystemTime(String mm) {
        System.out.println("#############Kaicom settime:");
        if(this.mPlatform != 1 && this.mPlatform != 4) {
            if(this.mPlatform == 5) {
                Intent intent = new Intent("com.kaicom.set_system_time");
                intent.putExtra("time", mm);
                if(this.mContext != null) {
                    this.mContext.sendBroadcast(intent);
                }

                System.out.println("#############Kaicom2 settime:");
            } else {
                System.out.println("#############Kaicom3 settime:");
                this.rongQi_SetSystemTime(mm);
            }
        } else {
            this.setSystemTime(mm);
        }

    }

    private native void setMachineCode(String var1);

    public void SetMachineCode(String code) {
        if(this.mPlatform != 1 && this.mPlatform != 4) {
            if(this.mPlatform != 2 && this.mPlatform != 3) {
                if(this.mPlatform == 5) {
                    Intent intent = new Intent("com.kaicom.set.machine.code");
                    intent.putExtra("com.kaicom.set.machine.code", code);
                    if(this.mContext != null) {
                        this.mContext.sendBroadcast(intent);
                    }
                }
            } else {
                this.rongQi_SetMachineCode(code);
            }
        } else {
            this.setMachineCode(code);
        }

    }

    private native String getMachineCode();

    @SuppressLint({"NewApi"})
    public String GetMachineCode() {
        return this.mPlatform != 1 && this.mPlatform != 4?(this.mPlatform != 2 && this.mPlatform != 3?(this.mPlatform == 5?Global.getString(this.mContext.getContentResolver(), "kaicom_machine_code"):null):this.rongQi_GetMachineCode()):this.getMachineCode();
    }

    public void disableKeypad() {
        Intent intent = new Intent("com.kaicom.disable_keypad");
        intent.putExtra("com.kaicom.disable_keypad", true);
        if(this.mContext != null) {
            this.mContext.sendBroadcast(intent);
        }

    }

    public void disableKeypadEnableCustom(String customstr) {
        Intent intent = new Intent("com.kaicom.disable_keypad");
        intent.putExtra("com.kaicom.disable_keypad", true);
        intent.putExtra("kaicom_disable_keypad_string", customstr);
        if(this.mContext != null) {
            this.mContext.sendBroadcast(intent);
        }

    }

    public void enableKeypad() {
        Intent intent = new Intent("com.kaicom.disable_keypad");
        intent.putExtra("com.kaicom.disable_keypad", false);
        if(this.mContext != null) {
            this.mContext.sendBroadcast(intent);
        }

    }

    public void enableKeydownTone() {
        if((this.mPlatform == 2 || this.mPlatform == 3 || this.mPlatform == 5) && this.mContext != null) {
            Intent intent = new Intent("com.kaicom.disable.keydowntone");
            intent.putExtra("com.kaicom.disable.keydowntone", false);
            new Build();
            if(Build.MODEL.equals("K7")) {
                intent.setPackage("com.android.kailibtest");
            }

            this.mContext.startService(intent);
        }

    }

    @SuppressLint({"NewApi"})
    public int GetStatusKeydownTone() {
        return (this.mPlatform == 2 || this.mPlatform == 5) && this.mContext != null?Global.getInt(this.mContext.getContentResolver(), "keydown_tone_enabled", 1):1;
    }

    public void disableKeydownTone() {
        if((this.mPlatform == 2 || this.mPlatform == 3 || this.mPlatform == 5) && this.mContext != null) {
            Intent intent = new Intent("com.kaicom.disable.keydowntone");
            intent.putExtra("com.kaicom.disable.keydowntone", true);
            new Build();
            if(Build.MODEL.equals("K7")) {
                intent.setPackage("com.android.kailibtest");
            }

            this.mContext.startService(intent);
        }

    }

    public void TurnOffStatusBarExpand() {
        Intent intent = new Intent("com.kaicom.disable_statusbar_expand");
        intent.putExtra("com.kaicom.disable_statusbar_expand", true);
        if(this.mContext != null) {
            this.mContext.sendBroadcast(intent);
        }

    }

    private native int getStatusBarExpand();

    @SuppressLint({"NewApi"})
    public int GetStatusBarExpand() {
        if(this.mPlatform == 2) {
            return this.mContext != null?Secure.getInt(this.mContext.getContentResolver(), "statusbar_enable_expand", 1):1;
        } else if(this.mPlatform != 3 && this.mPlatform != 5) {
            return this.getStatusBarExpand();
        } else if(this.mContext != null) {
            System.out.println("###########################get1：" + Global.getInt(this.mContext.getContentResolver(), "statusbar_enable_expand", 1));
            return Global.getInt(this.mContext.getContentResolver(), "statusbar_enable_expand", 1);
        } else {
            return 1;
        }
    }

    public void TurnOnStatusBarExpand() {
        Intent intent = new Intent("com.kaicom.disable_statusbar_expand");
        intent.putExtra("com.kaicom.disable_statusbar_expand", false);
        if(this.mContext != null) {
            this.mContext.sendBroadcast(intent);
        }

    }

    public void TurnOffUSBDebug() {
        Intent intent = new Intent("com.kaicom.disable_usb_debug");
        intent.putExtra("com.kaicom.disable_usb_debug", true);
        if(this.mContext != null) {
            this.mContext.sendBroadcast(intent);
        }

    }

    private native int getStatusUSBDebug();

    @SuppressLint({"NewApi"})
    public int GetStatusUSBDebug() {
        if(this.mPlatform == 2) {
            return this.mContext != null?Secure.getInt(this.mContext.getContentResolver(), "adb_enabled", 0):0;
        } else if(this.mPlatform != 3 && this.mPlatform != 5) {
            return this.getStatusUSBDebug();
        } else if(this.mContext != null) {
            System.out.println("###########################get2：" + Global.getInt(this.mContext.getContentResolver(), "adb_enabled", 0));
            return Global.getInt(this.mContext.getContentResolver(), "adb_enabled", 0);
        } else {
            return 0;
        }
    }

    public void TurnOnUSBDebug() {
        Intent intent = new Intent("com.kaicom.disable_usb_debug");
        intent.putExtra("com.kaicom.disable_usb_debug", false);
        if(this.mContext != null) {
            this.mContext.sendBroadcast(intent);
        }

    }

    public void TurnOffInstallManager() {
        Intent intent = new Intent("com.kaicom.disable.install.package");
        intent.putExtra("com.kaicom.disable.install.package", 0);
        if(this.mContext != null) {
            this.mContext.sendBroadcast(intent);
        }

    }

    private native int getStatusInstallManager();

    @SuppressLint({"NewApi"})
    public int GetStatusInstallManager() {
        return this.mPlatform == 2?(this.mContext != null?Secure.getInt(this.mContext.getContentResolver(), "install_enabled", 1):1):(this.mPlatform != 3 && this.mPlatform != 5?(this.mPlatform != 1 && this.mPlatform != 4?-1:this.getStatusInstallManager()):(this.mContext != null?Global.getInt(this.mContext.getContentResolver(), "install_enabled", 1):1));
    }

    public void TurnOnInstallManager() {
        Intent intent = new Intent("com.kaicom.disable.install.package");
        intent.putExtra("com.kaicom.disable.install.package", 1);
        if(this.mContext != null) {
            this.mContext.sendBroadcast(intent);
        }

    }

    public void TurnOnScreenLock() {
        Intent intent = new Intent("com.kaicom.disable.screen_lock");
        intent.putExtra("com.kaicom.disable.screen_lock", false);
        if(this.mPlatform != 1 && this.mPlatform != 5) {
            if(this.mPlatform == 2 || this.mPlatform == 4 || this.mPlatform == 3) {
                new Build();
                if(Build.MODEL.equals("K7")) {
                    intent.setPackage("com.android.kailibtest");
                }

                if(this.mContext != null) {
                    this.mContext.startService(intent);
                }
            }
        } else if(this.mContext != null) {
            this.mContext.sendBroadcast(intent);
        }

    }

    private native int getStatusScreenLock();

    @SuppressLint({"NewApi"})
    public int GetStatusScreenLock() {
        if(this.mPlatform == 2) {
            return this.mContext != null?android.provider.Settings.System.getInt(this.mContext.getContentResolver(), "screen_lock_on", 1):1;
        } else if(this.mPlatform != 3 && this.mPlatform != 5) {
            return this.mPlatform == 1?(this.mContext != null?Secure.getInt(this.mContext.getContentResolver(), "com.kaicom.disable.screen_lock", 1):1):(this.mPlatform == 4?this.getStatusScreenLock():-1);
        } else if(this.mContext != null) {
            System.out.println("###########################get3：" + android.provider.Settings.System.getInt(this.mContext.getContentResolver(), "screen_lock_on", 1));
            return Global.getInt(this.mContext.getContentResolver(), "screen_lock_on", 1);
        } else {
            return 1;
        }
    }

    public void TurnOffScreenLock() {
        Intent intent = new Intent("com.kaicom.disable.screen_lock");
        intent.putExtra("com.kaicom.disable.screen_lock", true);
        if(this.mPlatform != 1 && this.mPlatform != 5) {
            if(this.mPlatform == 2 || this.mPlatform == 4 || this.mPlatform == 3) {
                new Build();
                if(Build.MODEL.equals("K7")) {
                    intent.setPackage("com.android.kailibtest");
                }

                if(this.mContext != null) {
                    this.mContext.startService(intent);
                }
            }
        } else if(this.mContext != null) {
            this.mContext.sendBroadcast(intent);
        }

    }

    private native int getStatusWakeUp();

    public int GetStatusWakeUp() {
        return this.getStatusWakeUp();
    }

    private native void cfgPowerKeyWakeUp();

    public void CfgPowerKeyWakeUp() {
        if(this.mPlatform != 2 && this.mPlatform != 3 && this.mPlatform != 4) {
            if(this.mPlatform == 5) {
                Intent intent = new Intent("com.kaicom.anykey.wakeup");
                intent.putExtra("com.kaicom.anykey.wakeup", false);
                if(this.mContext != null) {
                    this.mContext.sendBroadcast(intent);
                }
            }
        } else {
            this.cfgPowerKeyWakeUp();
        }

    }

    private native void cfgAnyKeyWakeUp();

    public void CfgAnyKeyWakeUp() {
        if(this.mPlatform != 2 && this.mPlatform != 3 && this.mPlatform != 4) {
            if(this.mPlatform == 5) {
                Intent intent = new Intent("com.kaicom.anykey.wakeup");
                intent.putExtra("com.kaicom.anykey.wakeup", true);
                if(this.mContext != null) {
                    this.mContext.sendBroadcast(intent);
                }
            }
        } else {
            this.cfgAnyKeyWakeUp();
        }

    }

    private native int getStatusTouchscreen();

    private native void enableTouchpanel(int var1);

    private int getStatusTouchscreen420() {
        int ret = 0;
        if(this.mContext != null) {
            ret = Secure.getInt(this.mContext.getContentResolver(), "com.kaicom.disable.touch_screen", 0);
        }

        return ret;
    }

    public void Disable_touch_screen() {
        if(this.mPlatform != 1 && this.mPlatform != 5) {
            if(this.mPlatform == 2 || this.mPlatform == 3 || this.mPlatform == 4) {
                this.enableTouchpanel(0);
            }
        } else {
            Intent intent = new Intent("com.kaicom.disable.touch_screen");
            intent.putExtra("com.kaicom.disable.touch_screen", true);
            if(this.mContext != null) {
                this.mContext.sendBroadcast(intent);
            }
        }

    }

    public void Enable_touch_screen() {
        if(this.mPlatform != 1 && this.mPlatform != 5) {
            if(this.mPlatform == 2 || this.mPlatform == 3 || this.mPlatform == 4) {
                this.enableTouchpanel(1);
            }
        } else {
            Intent intent = new Intent("com.kaicom.disable.touch_screen");
            intent.putExtra("com.kaicom.disable.touch_screen", false);
            if(this.mContext != null) {
                this.mContext.sendBroadcast(intent);
            }
        }

    }

    public int GetStatusTouch_screen() {
        return 1 == this.GetPlatform()?this.getStatusTouchscreen420():(this.mPlatform != 2 && this.mPlatform != 3 && this.mPlatform != 4 && this.mPlatform != 5?-1:this.getStatusTouchscreen());
    }

    public void StoJNI_InstallApkWithSilence(String apkPath, boolean runAfterFinished) {
        if(this.mPlatform == 1 || this.mPlatform == 4 || this.mPlatform == 3 || this.mPlatform == 2 || this.mPlatform == 5) {
            Log.v("jdh", "#######################/mnt/sdcard/abc.apk install");
            Intent intent = new Intent("com.kaicom.install.packege.with.silence");
            intent.putExtra("com.kaicom.install.packege.extra.apk.path", apkPath);
            if(runAfterFinished) {
                intent.putExtra("com.kaicom.install.packege.extra.tips.format", 1);
            }

            this.mContext.sendBroadcast(intent);
        }

    }

    public void TurnOnOffGPS(boolean set) {
        if(this.mPlatform == 1 || this.mPlatform == 4) {
            Intent intent = new Intent("com.kaicom.config.gps.status");
            intent.putExtra("com.kaicom.config.gps.status", set);
            if(this.mContext != null) {
                this.mContext.sendBroadcast(intent);
            }
        }

    }

    public void TurnOnOffBrowser(boolean set) {
        Intent intent = new Intent("com.kaicom.disable.browser");
        intent.putExtra("com.kaicom.disable.browser", set);
        if(this.mContext != null) {
            this.mContext.sendBroadcast(intent);
        }

    }

    private native void enableTouchHomepanel(int var1);

    private native void enableTouchMenupanel(int var1);

    private native void enableTouchBackpanel(int var1);

    private native int getStatusTouchHomescreen();

    private native int getStatusTouchMenuscreen();

    private native int getStatusTouchBackscreen();

    public void Disable_home_touch_screen() {
        this.enableTouchHomepanel(0);
    }

    public void Enable_home_touch_screen() {
        this.enableTouchHomepanel(1);
    }

    public int GetStatusTouch_Home_screen() {
        return this.mPlatform == 3?this.getStatusTouchHomescreen():1;
    }

    public void Disable_menu_touch_screen() {
        this.enableTouchMenupanel(0);
    }

    public void Enable_menu_touch_screen() {
        this.enableTouchMenupanel(1);
    }

    public int GetStatusTouch_Menu_screen() {
        return this.mPlatform == 3?this.getStatusTouchMenuscreen():1;
    }

    public void Disable_back_touch_screen() {
        this.enableTouchBackpanel(0);
    }

    public void Enable_back_touch_screen() {
        this.enableTouchBackpanel(1);
    }

    public int GetStatusTouch_Back_screen() {
        return this.mPlatform == 3?this.getStatusTouchBackscreen():1;
    }

    public void setmScanCB(ScanCallBack mScanCB) {
        System.out.println("############setmScanCB:");
        this.mScanCB = mScanCB;
    }

    public void ScanResults(String str, int type) {
        System.out.println("#############扫描结果" + str);
        if(this.mScanCB != null) {
            this.mScanCB.onScanResults(str, type);
            this.mScanCB.onScanResults(str);
        }

    }

    public String getPdaBrand() {
        return "kaicom";
    }

    private void rongQi_SetSystemReboot() {
        if((this.mPlatform == 2 || this.mPlatform == 3) && this.mContext != null) {
            Intent intent = new Intent("com.kaili.reboot");
            new Build();
            if(Build.MODEL.equals("K7")) {
                intent.setPackage("com.android.kailibtest");
            }

            this.mContext.startService(intent);
        }

    }

    private void rongQi_SetSystemShutdown() {
        if((this.mPlatform == 2 || this.mPlatform == 3) && this.mContext != null) {
            Intent intent = new Intent("com.kaili.shutdown");
            new Build();
            if(Build.MODEL.equals("K7")) {
                intent.setPackage("com.android.kailibtest");
            }

            this.mContext.startService(intent);
        }

    }

    private void rongQi_SetSystemTime(String mm) {
        if((this.mPlatform == 2 || this.mPlatform == 3) && this.mContext != null) {
            Intent intent = new Intent("com.kaili.setsystemtime");
            intent.putExtra("time", mm);
            new Build();
            if(Build.MODEL.equals("K7")) {
                intent.setPackage("com.android.kailibtest");
            }

            this.mContext.startService(intent);
            System.out.println("#############K7 settime:");
        }

        System.out.println("#############Kaicom4 settime:");
    }

    private void rongQi_SetMachineCode(String code) {
        if((this.mPlatform == 2 || this.mPlatform == 3) && this.mContext != null) {
            Intent intent = new Intent("com.kaili.SetMachineCode");
            intent.putExtra("com.kaili.SetMachineCode", code);
            new Build();
            if(Build.MODEL.equals("K7")) {
                intent.setPackage("com.android.kailibtest");
            }

            this.mContext.startService(intent);
            System.out.println("########weiyima#####" + code);
        }

    }

    private String rongQi_GetMachineCode() {
        if(this.mPlatform != 2 && this.mPlatform != 3) {
            return null;
        } else {
            try {
                FileInputStream e = new FileInputStream("/data/app/machine_code.txt");
                if(e != null) {
                    BufferedReader buffer = new BufferedReader(new InputStreamReader(e));
                    String s = buffer.readLine();
                    if(s == null) {
                        return null;
                    }

                    return s;
                }

                e.close();
            } catch (IOException var5) {
                Log.v("Machine", var5.getMessage());
            }

            return null;
        }
    }

    public int getEventFuction(int keycode) {
        Log.d(TAG, "######" + TAG + "getEventFunction");
        new Build();
        if(Build.MODEL.equals("K7")) {
            switch(keycode) {
            case 2:
                return 2;
            case 3:
                return 3;
            case 4:
                return 4;
            case 7:
                return 7;
            case 8:
                return 8;
            case 9:
                return 9;
            case 10:
                return 10;
            case 11:
                return 11;
            case 12:
                return 12;
            case 13:
                return 13;
            case 14:
                return 14;
            case 15:
                return 15;
            case 16:
                return 16;
            case 17:
                return 17;
            case 18:
                return 18;
            case 23:
                return 23;
            case 24:
                return 24;
            case 25:
                return 25;
            case 66:
                return 66;
            case 67:
                return 67;
            case 82:
                return 82;
            case 103:
            case 110:
                return 110;
            case 131:
                return 119;
            case 133:
                return 133;
            default:
                return 0;
            }
        } else {
            switch(keycode) {
            case 2:
                return 134;
            case 4:
                return 4;
            case 7:
                return 7;
            case 8:
                return 8;
            case 9:
                return 9;
            case 10:
                return 10;
            case 11:
                return 11;
            case 12:
                return 12;
            case 13:
                return 13;
            case 14:
                return 14;
            case 15:
                return 15;
            case 16:
                return 16;
            case 17:
                return 17;
            case 18:
                return 18;
            case 19:
                return 19;
            case 20:
                return 20;
            case 21:
                return 21;
            case 22:
                return 22;
            case 23:
                return 23;
            case 24:
                return 24;
            case 25:
                return 25;
            case 64:
                return 133;
            case 67:
                return 67;
            case 82:
                return 1;
            case 96:
                return 131;
            case 97:
                return 132;
            case 102:
            case 103:
            case 110:
                return 110;
            case 104:
                return 137;
            case 105:
                return 138;
            case 106:
                return 135;
            case 107:
                return 136;
            default:
                return 0;
            }
        }
    }

    public String getJniVer() {
        return "kai-1.0.0.2";
    }

    public int getPlatform() {
        return this.GetPlatform();
    }
}
